# sub2assa
"""
Convert subtitles from formats recognized by aeidon/gaupol to Advanced Sub Station Alpha format.
"""

# Depends on the Python "aeidon" package, which is part of the "gaupol" project
# Available in Debian as "python-aeidon" package
# Or as download from: http://download.gna.org/gaupol

import aeidon
_ = aeidon.i18n._

def make_framerate(framerate):
    """
    Translate a framerate into something aeidon will understand.
    """
    class Framerate(aeidon.EnumerationItem):
        label = _("%2.3f fps" % framerate)
        mpsub = "%2.2" % framerate
        value = framerate
    return Framerate


def sub2assa(infile, outfile):
    """
    Attempt to import subtitles from 'infile' and then write
    them in ASSA format to 'outfile'.
    """
    p = aeidon.Project()
    p.open_main(infile, 'utf_8')
    p.save_main(aeidon.files.new(aeidon.formats.ASS, outfile, 'utf_8'))

    